package com.huaxin.hxmoduleworkorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huaxin.hxmoduleworkorder.dto.response.GetInspectionOrderCabinetRespDTO;
import com.huaxin.hxmoduleworkorder.models.InspectionOrderCabinet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface InspectionOrderCabinetMapper extends BaseMapper<InspectionOrderCabinet> {
    /**
     * 删除巡查工单配电箱关联
     *
     * @param orderId   工单ID
     * @param cabinetId 配电箱ID
     * @return 删除结果
     */
    Boolean delete(@Param("orderId") String orderId, @Param("cabinetId") String cabinetId);

    /**
     * 删除工单关联的工单配电箱
     *
     * @param orderId 工单ID
     * @return 删除结果
     */
    Boolean deleteByOrderId(@Param("orderId") String orderId);

    /**
     * 获取工单配电箱关联
     *
     * @param orderId 工单ID
     * @return 工单配电箱关联列表
     */
    Page<GetInspectionOrderCabinetRespDTO> getInspectionOrderCabinet(
            Page<GetInspectionOrderCabinetRespDTO> page,
            @Param("orderId") String orderId
    );
}
